import request from "../utils/request";

// 歌单分类接口----------------------------------

// 获取歌单分类列表
export const fetchPlaylistCategoryData = (params) => {
  return request({
    url: "/web/playlistCategory/getList",
    method: "get",
    params: params,
  });
};

// 创建/修改歌单分类
export const fetchCreateOrEdit = (data) => {
  return request({
    url: "/web/playlistCategory/create",
    method: "post",
    data: data,
  });
};

// 删除歌单分类
export const fetchDeleteCategor = (data) => {
  return request({
    url: "/web/playlistCategory/deleteById",
    method: "post",
    data: data,
  });
};

// 歌单标签管理接口--------------------------------

// 查看标签树
export const fetchPlaylistTagTreeData = (params) => {
  return request({
    url: "/web/playlistTag/detailTagTree",
    method: "get",
    params: params,
  });
};

// 创建/修改歌单标签管理,返回标签id
export const fetchPlaylistTagCreate = (data) => {
  return request({
    url: "/web/playlistTag/create",
    method: "post",
    data: data,
  });
};

// 删除歌单标签管理
export const fetchPlaylistTagDeleteById = (data) => {
  return request({
    url: "/web/playlistTag/deleteById",
    method: "post",
    data: data,
  });
};

// 歌曲分类接口-----------------------------------

// 获取歌曲分类列表
export const fetchSongCategoryData = (params) => {
  return request({
    url: "/web/songCategory/getList",
    method: "get",
    params: params,
  });
};

// 创建/修改歌曲分类
export const fetchCreateOrEditSong = (data) => {
  return request({
    url: "/web/songCategory/create",
    method: "post",
    data: data,
  });
};

// 删除歌曲分类
export const fetchDeleteCategorSong = (data) => {
  return request({
    url: "/web/songCategory/deleteById",
    method: "post",
    data: data,
  });
};

// 歌曲标签管理接口--------------------------------

// 查看标签树
export const fetchSongTagTreeData = (params) => {
  return request({
    url: "/web/songTag/detailTagTree",
    method: "get",
    params: params,
  });
};

// 创建/修改歌曲标签管理,返回标签id
export const fetchSongTagCreate = (data) => {
  return request({
    url: "/web/songTag/create",
    method: "post",
    data: data,
  });
};

// 删除歌曲标签管理
export const fetchSongTagDeleteById = (data) => {
  return request({
    url: "/web/songTag/deleteById",
    method: "post",
    data: data,
  });
};

// 版权方管理----------------------
// 获取版权方管列表
export const fetchCopyrightOwnerData = (params) => {
  return request({
    url: "/web/copyrightOwnerManagement/getList",
    method: "get",
    params: params,
  });
};

// 创建/修改版权方
export const fetchCopyrightOwnerCreate = (data) => {
  return request({
    url: "/web/copyrightOwnerManagement/create",
    method: "post",
    data: data,
  });
};

// 删除版权方管
export const fetchDeleteCopyrightOwne = (data) => {
  return request({
    url: "/web/copyrightOwnerManagement/deleteById",
    method: "post",
    data: data,
  });
};

// 订阅配置接口-------------------------
// 获取订阅配置列表
export const fetchSubscriptionConfig = (params) => {
  return request({
    url: "/web/subscriptionConfig/getList",
    method: "get",
    params: params,
  });
};
// 创建/修改订阅配置
export const fetchSubscriptionCreate = (data) => {
  return request({
    url: "/web/subscriptionConfig/create",
    method: "post",
    data: data,
  });
};
// 删除订阅配置
export const fetchSubscriptionConfigDelete = (data) => {
  return request({
    url: "/web/subscriptionConfig/deleteById",
    method: "post",
    data: data,
  });
};
// 启用，其他的配置会禁用
export const fetchSubscriptionEnabledConfig = (params) => {
  return request({
    url: "/web/subscriptionConfig/enabledConfig",
    method: "get",
    params: params,
  });
};

// 歌曲接口
// 获取推荐歌曲列表
export const fetchRecommendedList = (params) => {
  return request({
    url: "/web/song/getRecommendedList",
    method: "get",
    params: params,
  });
};
